<template>
  <view>
    <view class="cu-bar bg-white solid-bottom margin-top margin-left margin-right">
      <view class="action">
        <text class="cuIcon-title text-custom">订单管理</text>
      </view>
    </view>
<!--    <view class="cu-bar bg-white search">-->
<!--      <view class="search-form round">-->
<!--        <text class="cuIcon-search"></text>-->
<!--        <input type="text" placeholder="搜索cuIcon" confirm-type="search" @input="searchIcon" />-->
<!--      </view>-->
<!--    </view>-->
    <!--    style="margin-top: 50px"-->
    <view class="cu-list menu-avatar margin-right margin-left">
      <view class="cu-item" v-for="(item,idx) in orderList" :key="idx">
        <view class="content" style="left: 10rpx">
          <view class="text-grey"> {{item.poiName}} </view>
          <view class="text-gray text-sm flex">
            <view class="text-cut">
              <!--              <text class="cuIcon-infofill text-red  margin-right-xs"></text>-->
              {{item.productName}}
            </view>
          </view>
        </view>
        <view class="action">
          <!--          <view class="text-grey text-xs">22:20</view>-->
          <view class="cu-tag round bg-grey sm">{{item.payAmount}}</view>
        </view>
      </view>
    </view>
    <!--    <scroll-view class="bg-white nav">-->
    <!--      <ul class="vul">-->
    <!--        <li class="vli" v-for="(item,idx) in orderList" :key="idx">-->
    <!--          <view>-->
    <!--            <view style="display:flex;">-->
    <!--              <view>-->
    <!--                {{item.poiName}}-->
    <!--              </view>-->
    <!--              <view style="flex: 9;text-align: right">-->
    <!--                金额:{{item.payAmount}}元-->
    <!--              </view>-->
    <!--            </view>-->
    <!--            <view>-->
    <!--              {{item.productName}}-->
    <!--            </view>-->
    <!--          </view>-->
    <!--        </li>-->
    <!--      </ul>-->
    <!--      <view class="cu-load bg-blue" style="display: none" :class="!isLoad?'loading':'over'"></view>-->
    <!--    </scroll-view>-->
  </view>
</template>

<script setup lang="ts">
import {onReachBottom,onLoad} from "@dcloudio/uni-app";
import {ref, onMounted, reactive, toRaw} from 'vue';
import {getOrderList} from '../../common/api/order'
import {useStore} from "../../common/store";
import IndexTools from "./IndexTools.vue";
const store = useStore();
const loadProgress = ref(1)
const  searchIcon = (e) => {
  let key = e.detail.value;
  console.log('key:',key)
}
const isLoad = ref(false)

const orderList = reactive([])

onMounted(() => {
  loadOrderList()
})

const loadOrderList = async () => {
  const id = store.userId?store.userId:1
  await getOrderList(id).then(res => {
    if (res.code == 200) {
      res.data.forEach(item=>{
        orderList.push(item)
      })
    }
  })
}

onReachBottom(()=>{
  console.log('loading more')
})
</script>

<style lang="scss" scoped>

</style>
